home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / pov / povlisti.ngs / truchet6.pov < prev    next >
Encoding:
Text File  |  1992-03-21  |  4.2 KB  |  152 lines

  1. // Persistence of Vision Raytracer Version 1.0
  2. //  3 path Truchet tiles.  Very well bounded, traces in about 6 hours at
  3. // 640x480  +a0.2 on a 486/33.
  4. // Image by Dan Farmer
  5. #include "colors.inc"
  6. #include "shapes.inc"
  7. #include "textures.inc"
  8.  
  9. camera {
  10.     location <15 30 -60>
  11.     direction <0 0 4>
  12.     up  <0 1 0>
  13.     right <1.33333 0 0>
  14.     look_at <0 0 0>
  15. }
  16.  
  17. object {
  18.    light_source { <5 50 -50>
  19.    colour red 0.85 green 0.85 blue 0.85
  20.    spotlight
  21.    point_at <0 0 0>
  22.    tightness 60
  23.    radius 8
  24.    falloff 16
  25.     }
  26. }
  27. object {
  28.    light_source { <5 100 150>
  29.    colour red 0.4 green 0.4 blue 0.4
  30.    spotlight
  31.    point_at <0 0 0>
  32.    tightness 60
  33.    radius 8
  34.    falloff 16
  35.     }
  36. }
  37.  
  38. //  Outer radius: 1.25  Inner radius: 0.75
  39. #declare Torus = quartic {
  40.    <    1.000000 0.000000 0.000000 0.000000 2.000000
  41.         0.000000 0.000000 2.000000 0.000000 -2.125000
  42.         0.000000 0.000000 0.000000 0.000000 0.000000
  43.         0.000000 0.000000 0.000000 0.000000 0.000000
  44.         1.000000 0.000000 0.000000 2.000000 0.000000
  45.         1.875000 0.000000 0.000000 0.000000 0.000000
  46.         1.000000 0.000000 -2.125000 0.000000 0.878906 >
  47.  }/* end_quartic */
  48.  
  49. // Untransformed torus lines in x/z plane
  50. // Create a 3-Path tile using these elbow macaroni pieces
  51. #declare Tile = object {
  52.     union {
  53.         quartic { Torus rotate <90 0 0> translate <-1 1 0>   }
  54.         quartic { Torus rotate <0 0 0>  translate <1 0 1>    }
  55.         quartic { Torus rotate <0 0 -90> translate <0 -1 -1> }
  56.     }
  57.     clipped_by {
  58.         box { UnitBox scale < 1.25 1.25 1.25 > }
  59.     }
  60.     texture {
  61.         Shiny
  62.         color White
  63.     }
  64.     bounded_by {
  65.         box { UnitBox scale < 1.26 1.26 1.26> }
  66.     }
  67.     color Red
  68. }
  69.  
  70. // Note that these can be applied in any order.
  71. #declare Tile1= object { Tile rotate <  0   0   0> }
  72. #declare Tile2= object { Tile rotate < 90   0   0> }
  73. #declare Tile3= object { Tile rotate <180   0   0> }
  74. #declare Tile4= object { Tile rotate <270   0   0> }
  75. #declare Tile5= object { Tile rotate <  0  90   0> }
  76. #declare Tile6= object { Tile rotate <  0 180   0> }
  77. #declare Tile7= object { Tile rotate <  0 270   0> }
  78. #declare Tile8= object { Tile rotate <  0   0  90> }
  79. #declare Tile9= object { Tile rotate <  0   0 180> }
  80.  
  81. // A 3 x 1 x 3 layer of "tiles"
  82. #declare Layer = composite {
  83.     composite {   // Center Row
  84.         object { Tile1 translate <-2.5 0 0>}
  85.         object { Tile2 translate <0 0 0>}
  86.         object { Tile3 translate <+2.5 0 0>}
  87.         bounded_by {
  88.             box { UnitBox scale < 5.1 1.26 1.26> }
  89.         }
  90.     }
  91.     composite {   // Front row
  92.         object { Tile4 translate <-2.5 0 0>}
  93.         object { Tile5 translate <0 0 0>}
  94.         object { Tile6 translate <+2.5 0 0>}
  95.         bounded_by {
  96.             box { UnitBox scale < 3.76 1.26 1.26> }
  97.         }
  98.         rotate <90 0 0>
  99.         translate <0 0 2.5>
  100.     }
  101.     composite {   // Back row
  102.         object { Tile7 translate <-2.5 0 0>}
  103.         object { Tile8 translate <0 0 0>}
  104.         object { Tile9 translate <+2.5 0 0>}
  105.         bounded_by {
  106.             box { UnitBox scale < 3.76 1.26 1.26> }
  107.         }
  108.         rotate <270 0 0>
  109.         translate <0 0 -2.5>
  110.     }
  111.     bounded_by {
  112.         box { UnitBox scale < 3.76 1.26 5.1> }
  113.     }
  114. }
  115.  
  116. // Three layers stacked into a 3 x 3 x 3 tile cube
  117. #declare Cube3x3x3 = composite {
  118.     composite { Layer translate <0 2.5 0> }
  119.     composite { Layer}
  120.     composite { Layer translate <0 -2.5 0> }
  121.     bounded_by {
  122.         box { UnitBox scale < 3.76 3.76 3.76> }
  123.     }
  124. }
  125.  
  126. #declare Row9x3x9 = composite {
  127. composite { Cube3x3x3 }
  128. composite { Cube3x3x3 translate <7.5 0 0> }
  129. composite { Cube3x3x3 rotate <90 0 0> translate < -7.5 0 0> }
  130.     bounded_by {
  131.         box { UnitBox scale < 11.26 3.76 11.26> }
  132.     }
  133. }
  134. composite { Row9x3x9 }
  135. /*
  136. #declare Layer9x6x9 = composite {
  137.     composite { Row9x3x9 translate <0 0 0>   }
  138.     composite { Row9x3x9 translate <0 0 -7.5>}
  139.     composite { Row9x3x9 translate <0 0  7.5>}
  140.  
  141.     composite { Row9x3x9 translate <0 7.5   0>  }
  142.     composite { Row9x3x9 translate <0 7.5  -7.5>}
  143.     composite { Row9x3x9 translate <0 7.7   7.5>}
  144.     bounded_by {
  145.         box { UnitBox scale < 11.26 11.26 11.26> }
  146.     }
  147. }
  148.  
  149. composite { Layer9x6x9 }
  150. */
  151.  
  152.